package org.lc.stk.web.dto.cengci;

import java.time.LocalDateTime;

import org.lc.stk.model.baseInfo.Cengci;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "培养层次响应")
public class CengciResponse {
    
    @Schema(description = "培养层次ID", example = "1")
    private Integer id;
    
    @Schema(description = "培养层次编码", example = "BK")
    private String code;
    
    @Schema(description = "培养层次名称", example = "本科")
    private String name;
    
    @Schema(description = "排序号", example = "1")
    private Integer orderNum;
    
    @Schema(description = "备注", example = "普通本科教育")
    private String remark;
    
    @Schema(description = "是否删除", example = "false")
    private Boolean isDeleted;
    
    @Schema(description = "创建时间", example = "2025-02-11 16:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    
    @Schema(description = "更新时间", example = "2025-02-11 16:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    public static CengciResponse fromEntity(Cengci entity) {
        if (entity == null) {
            return null;
        }
        
        CengciResponse response = new CengciResponse();
        response.setId(entity.getId());
        response.setCode(entity.getCode());
        response.setName(entity.getName());
        response.setOrderNum(entity.getOrderNum());
        response.setRemark(entity.getRemark());
        response.setIsDeleted(entity.getIsDeleted());
        response.setCreateTime(entity.getCreateTime());
        response.setUpdateTime(entity.getUpdateTime());
        return response;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}